<template>
  <vue-office-excel :src="params.url" @rendered="rendered" />
</template>

<script lang="ts" setup>
import { showLoading, hideLoading, getCurrentInstance } from '@tarojs/taro';
import { onMounted } from 'vue';
//引入VueOfficeExcel组件
import VueOfficeExcel from '@vue-office/excel';
//引入相关样式
import '@vue-office/excel/lib/index.css';

/**
 * @description 当前路由信息
 */
const params = getCurrentInstance().router?.params as {
  url: string;
};

function rendered() {
  hideLoading();
  console.log('渲染完成');
}

onMounted(() => {
  showLoading();
});
</script>
